﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DeepZoomPivotConstructor.VisualLib
{
    /// <summary>
    /// A place holder for an already rendered deep zoom image (a compositional unit).
    /// </summary>
    public class VisualItemPlaceHolder : VisualBasicSingleImage
    {
        /// <summary>
        /// Init with default width and height
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        public VisualItemPlaceHolder(double w, double h, FileInfo xmlFile, Visual.VisualInfo metaData, object whatRequested)
        {
            _width = w;
            _height = h;
            XMLFile = xmlFile;
            Info = metaData;

            ///
            /// We are representing something that was a CU previously, so we'd better
            /// mark ourselves as such again!
            /// 

            SetAsComposableUnit(null, Path.ChangeExtension(xmlFile.Name, null));

            CompositionInfo.Width = w;
            CompositionInfo.Height = h;
            CompositionInfo.RenderObject = whatRequested;
        }

        public FileInfo XMLFile { get; private set; }

        /// <summary>
        /// Returns nothing - null!
        /// </summary>
        public override List<SceneGraphSceneNode> SGNodeList
        {
            get { return new List<SceneGraphSceneNode>(); }
        }
    }
}
